package eiisan.function;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * TODO
 *
 * @author gragonfly
 * @date 2019/8/6
 **/
public class CollectionsDemo {
    public static void main(String[] args) {
        List<String> names = new ArrayList<>();
        names.add("aa");
        names.add("bb");
        Collections.sort(names, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                System.out.println(o1.compareTo(o2));
                return o1.compareTo(o2);
            }
        });
        System.out.println(names);
    }
}
